VNC Viewer ActiveX Control

VNC Viewer ActiveX Control is a independent control that realizes all the vnc viewer's function. It need not any other libraries. The Details include:

Installation


Open the "VNCViewerXControl.ocx" with Regsvr32.exe,then you can use the control in all develop tools.

Properties


There are several properties of the control:

Published:

Public:

 

AutoScroll

property AutoScroll as Boolean;

Description

If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the control so that some of its controls are partially obscured, scroll bars appear.

If AutoScroll is false, scroll bars don't appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.

If the property Stretch is set, it will take no effect.

 

Codec

Property Codec as TVNCCodec;

TVNCCodec=(vncHextile, vncCoRRE, vncRRE, vncCopyRect, vncRAW)

 

EnableBell

Property EnableBell as boolean;

Description

if EnableBell is true, the viewer will bell when the server bell.

 

FrameUpdateDelay

Property FrameUpdateDelay as Word;

Description

FrameUpdateDelay determines how frequently the viewer will request frames updating from the server in milliseconds

 

Password

Property Password as String;

description

The login password of the viewer.

 

Port

Property Port as Integer;

Description

The login Port of the viewer.

 

Server

Property Server as String;

Description

The Address the viewer will connect to.

 

RequestFrames

Property RequestFrames as Boolean;

Description

If the RequestFrames is true, the viewer will reuqest updating from the server every "RequestFramesDelay" milliseconds. Or the viewer will never update.

 

PixelFormat

Property PixelFormat as TPixelFormat;

TPixelFormat=(VNCAuto,VNC8Bit)

 

ShareDesktop

Property ShareDesktop as Boolean;

Description

If ShareDesktop is ture, the server will not disconnect other clients when the viewer logined.

 

Stretch

Property Stretch as Boolean;

Description

If Stretch is true, the remote screen will stretch to the width and height the user set. And the property AutoScroll will take no effect.

 

TransferKeys

Property TransferKeys as boolean;

Description

if TransferKeys is true, The viewer will transfer the key actions to the server.

 

TransferMouse

Property TransferMouse as boolean;

Description

if TransferMouse is true, The viewer will transfer the mouseactions to the server.

 

TransferLocalClipboard

Property TransferLocalClipboard as boolean;

Description

if TransferLocalClipboard is true, The viewer will transfer the local clipboard actions to the server.

 

TransferServerClipboard

Property TransferServerClipboard as boolean;

Description

if TransferServerClipboard is true, server will transfer the server clipboard actions to the viewer.

 

xPosition

Property xPosition as Integer;

Description

xPosition is x position of the left-top point of the remote screen Which will display in the viewer control's rectangle.

 

yPosition

Property yPosition as Integer;

Description

yPosition is yposition of the left-top point of the remote screen Which will display in the viewer control's rectangle

 

Method


The VNC Viewer Control have three method:

 

Connect

Sub Connect;

Description

Connect to the server using the property "Server", "Port", "Password" are set.

 

Disconnect

Sub Disconnect;

Description

Disconnect the viewer from server.

 

RequestUpdate

Sub RequestUpdate;

Descriptio

Force the viewer to update a frame.

 

Events


The VNC Viewer control have seven special events:

 

OnAuthFail

Sub OnAuthFail()

Description

When the viewer login to server fail, the event will occur.

 

OnConnectClose

Sub OnConnectClose()

Description

When the viewer disconnect from server, the event will occur.

 

OnConnected

Sub OnConnected()

Description

When the Viewer connected to the server, the event occurs

 

OnConnectError

Sub OnConnectError( ErrorMsg as String);

Description

When error happened during the viewer is connecting to the server, the event occurs. The ErrorMsg is the error message.

 

OnFrameSize

Sub OnFrameSize( FrameWidth,FrameHeight as Integer);

Description

When viewer login to server successfully, the server will return the width and height of the remote screen, then the event occurs. FrameWidth and FrameHeight are the width and height of remote screen.

 

OnHostName

Sub OnHostname( HostName as String);

Description

When viewer login to server successfully, the server will return the name of the remote host. HostName is the name of the remote host.

 

OnStatus

Sub OnStatus( ErrorMsg as String);

Description

The event occurs during the login process. The ErrorMsg is the message return.

 

Example


There is an example in the folder samples. The sample project demostrate all the properties and method of the control.